import { createWebHistory, createRouter } from 'vue-router'

const Index = () => import('@/page/userView/Index.vue');
const Login = () => import('@/page/login/Login.vue');
const AdminMain = () => import('@/page/adminView/AdminMain.vue');
const UserLogin = () => import('@/page/adminView/UserLogin.vue');
const User = () => import('@/page/adminView/User.vue');
const Role = () => import('@/page/adminView/Role.vue');
const UserRole = () => import('@/page/adminView/UserRole.vue');
const Permission = () => import('@/page/adminView/Permission.vue');
const RequestPath = () => import('@/page/adminView/RequestPath.vue');
const ReqPathPermission = () => import('@/page/adminView/ReqPathPermission.vue');
const RolePermission = () => import('@/page/adminView/RolePermission.vue');

const routes = [
  { path: '/', component: Index },
  { path: '/login', component: Login },
  { path: '/index', component: Index },
  { 
    path: '/admin/main', 
    component: AdminMain,
    meta: {
      hidden: true,
      title:"网盘系统管理页面"
    },
    children: [
      {
        path: 'userLogin',
        component: UserLogin
      },
      {
        path: 'user',
        component: User
      },
      {
        path: 'role',
        component: Role
      },
      {
        path: 'userRole',
        component: UserRole
      },
      {
        path: 'permission',
        component: Permission
      },
      {
        path: 'requestPath',
        component: RequestPath
      },
      {
        path: 'reqPathPermission',
        component: ReqPathPermission
      },
      {
        path: 'rolePermission',
        component: RolePermission
      }
    ]
   },
]

const router = createRouter({
  history: createWebHistory(),
  routes,
})

export default router